home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pinstaller / tests / GLITestControllerScript.py < prev    next >
Text File  |  2005-08-22  |  2KB  |  52 lines

  1. # Copyright 1999-2005 Gentoo Foundation
  2. # This source code is distributed under the terms of version 2 of the GNU
  3. # General Public License as published by the Free Software Foundation, a copy
  4. # of which can be found in the main directory of this project.
  5.  
  6. import unittest
  7. import os
  8. import GLIInstallProfile
  9. import GLIInstallTemplate
  10. import GLILogger
  11. import GLIClientController
  12. import GLIClientConfiguration
  13. import GLIUtility
  14. from GLIClientConfiguration import ClientConfiguration
  15.  
  16. config = ClientConfiguration()
  17.  
  18. class test_GLIInstall (unittest.TestCase):
  19.  
  20.     def setUp(self):
  21.         self.failUnless(os.path.exists("GLITestInstallScript.py"), "Please run tests from src")
  22.         self.failUnless(os.path.exists("GLIInstallTemplate.py"), "Please run tests from src")
  23.  
  24.     def testTheLogger(self):
  25.         logger = GLILogger.Logger.shared_logger();
  26.         self.failUnless(logger, "Could not get shared logger");
  27.         logger.log("Test log message one.")
  28.         logger.mark()
  29.         
  30.     def testCLIENTCONTROLLER(self):
  31.         logger = GLILogger.Logger.shared_logger();
  32.         self.failUnless(logger, "Could not get shared logger");    
  33.         logger.mark()
  34.         logger.log("Starting the client configuration.")
  35.         print "Starting the client configuration."
  36.         configuration = GLIClientConfiguration.ClientConfiguration()
  37.         configuration.parse('./laptop.config.xml')
  38.         controller = GLIClientController.GLIClientController(configuration)
  39.         logger.log("Controller Instantiated.  Setting root password.")
  40.         print "Controller Instantiated.  Setting root password."
  41.         controller.set_root_passwd()
  42.         
  43.         logger.log("Now configuring the networking (pre) of the livecd")
  44.         print "Now configuring the networking (pre) of the livecd"
  45.         controller.configure_networking()
  46.         
  47.         logger.log("Now startign up SSH if you have it enabled during the install.")
  48.         print "Now startign up SSH if you have it enabled during the install."
  49.         controller.enable_ssh()
  50. if __name__ == '__main__':
  51.     unittest.main()
  52.